<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" import="java.util.List,com.systop.scos.news.model.News"%>
<html>
<head>
<%@include file="/common/taglibs.jsp"%>
<title>后台首页</title>
<LINK href="${ctx}/styles/style.css" type='text/css' rel='stylesheet'>
<style type="text/css">
	.deskpane{
		margin:5px 5px;
		border: 1px solid #99BBE8;
		height: 240px;
		background-color: white;
	}
	.top {
		height: 25px;
		padding-top: 5px;
		font-weight: bold;
		background-image:url(${ctx}/scripts/extjs/resources/images/default/toolbar/bg.gif);
		border-bottom: 1px solid #99BBE8;
	}
	.navbar{
		height: 25px;
		line-height: 25px;
		padding:0px 10px;
		border-bottom: 1px dashed #99BBE8;
	}
	.navbar_item{
		float: left;
		color: #000;
		padding: 0px 5px;
		cursor: pointer;
	}
	.content{
		padding: 5px 10px;
	}
	.over{
		background-color: #99BBE8;
	}
	.out{
		background-color: #FFF;
	}
	li{
		height: 25px;
		line-height: 25px;
	}
</style>
</head>
<body bgcolor="#D6E4EF">
<div class="x-panel-header"></div>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="60%">
      <div id="news" class="deskpane">
        <div class="top">
            <img src="${ctx}/images/icons/go.gif" >
            <a href="${ctx}/news/index.do">新 闻</a>
        </div>
        <div class="navbar">
          <div class="navbar_item" onmousemove="over(this, 'news', '0', '${newsTypeCount}')" onmouseout="out(this)">
          	<b>全部</b>
          </div>
          <!-- news's catalog -->
          <s:iterator value="data.newsTypes" var="newsType" status="s">
             <div class="navbar_item" onmousemove="over(this, 'news', '${s.count}', '${newsTypeCount}')" onmouseout="out(this)">
               ${newsType.name}
             </div>
          </s:iterator>
        </div>
        <div class="content">
	        <!-- All news start  -->
	        <div id="news0">
	          <s:iterator value="data.news" var="n">
	            <li>
	              <a title="${n.title}" href="${ctx}/news/view.do?model.id=${n.id}" target="_blank">
	                <s:date name="createTime" format="MM-dd"/>【${n.newsType.name}】${n.title} 
	              </a>
			    </li>
			  </s:iterator>
	        </div>
	        <!-- All news end  -->
	        <!-- view news whith different catalog start -->
	        <s:iterator value="newsList" var="ntlist" status="s"> 
		        <div id="news${s.count}" style="display:none;">
		        	<s:iterator value="ntlist" var="n">
		            	<li>
			              <a title="${n.title}" href="${ctx}/news/view.do?model.id=${n.id}" target="_blank">
			                <s:date name="createTime" format="MM-dd"/>【${n.newsType.name}】${n.title}
			              </a>
					    </li>
					</s:iterator>        
		        </div>
	        </s:iterator>
	        <!-- view news whith different catalog end -->
        </div>
      </div>    
    </td>
    
    <td width="40%">
      <div id="notice" class="deskpane">
        <div class="top">
            <img src="${ctx}/images/icons/go.gif" >
            <a href="${ctx}/notice/index.do">公 告</a>
        </div>
        <div class="content">
          <div>  
	        <s:iterator value="data.notices" var="notice">
	          <li>
	            <a title="${notice.title}" href="${ctx}/notice/view.do?model.id=${notice.id}" target="_blank">
	            <s:date name="createTime" format="MM-dd"/>&nbsp;&nbsp;${notice.title}</a>
	          </li>
			</s:iterator>
		  </div>
        </div>
      </div>
    </td>
  </tr>
  
  <tr>
    <td colspan="2" height="5"></td>
  </tr>
  
  <tr>
    <td>
	  <div id="diary" class="deskpane">
        <div class="top">
            <img src="${ctx}/images/icons/go.gif" >
            <a href="${ctx}/diary/index.do">工作日志</a>
        </div>
          <div class="navbar">
          	 <div class="navbar_item" onmousemove="over(this, 'diarys', 0, '${diaryTypeCount}')" onmouseout="out(this)">
	          	<b>全部</b>
	          </div>
	          <!-- news's catalog -->
	          <s:iterator value="data.diaryTypes" var="diaryType" status="s">
	             <div class="navbar_item" onmousemove="over(this, 'diarys', '${s.count}','${diaryTypeCount}')" onmouseout="out(this)">
	               ${diaryType.name}
	             </div>
	          </s:iterator>
          </div>
        <div class="content">
          <div id="diarys0">
          	<s:iterator value="data.diarys" var="diary">
            	<li>
                  <a title="${diary.title}" href="${ctx}/diary/view.do?model.id=${diary.id}" target="_blank">
                  <s:date name="createDate" format="MM-dd"/>【${diary.diaryType.name}】${diary.title}</a>
            	</li>
		    </s:iterator>
		  </div>
		  <s:iterator value="diarysList" var="dtlist" status="s">
		  	<div id="diarys${s.count}" style="display:none;">
            	<s:iterator value="dtlist" var="diary">
            		<li>
	                  <a title="${diary.title}" href="${ctx}/diary/view.do?model.id=${diary.id}" target="_blank">
	                  <s:date name="createDate" format="MM月dd日"/>【${diary.diaryType.name}】${diary.title}</a>
	            	</li>
		    	</s:iterator>
		  	</div>
		  </s:iterator>
		</div>
      </div>
    </td>
    <td>
    	<div id="mail" class="deskpane">
	        <div class="top">
	          <img src="${ctx}/images/icons/go.gif" >
	          <a href="${ctx}/mail/index.do?mailIndexType=receive">内部邮件</a>      
	        </div>
	        <div class="content">
	          <div>
		        <s:iterator value="data.mailBoxs" var="mb">
		        	<li style="overflow: hidden; text-overflow:ellipsis;">
		              <a title="${mb.mail.senderName}:${mb.mail.subject}" href="${ctx}/mail/view.do?mailId=${mb.id}" target="main">
		              <s:date name="sendTime" format="MM-dd HH:mm"/>&nbsp;&nbsp;${mb.mail.subject}</a>
		        	</li>
				</s:iterator>
			  </div>
	        </div>
	      </div>
    </td>
  </tr>
  
   <tr>
    <td colspan="3" height="5"></td>
  </tr>
  
  <tr>
    <td>
      <div id=schedule class="deskpane">
        <div class="top">
        	<img src="${ctx}/images/icons/go.gif" >
        	<a href="${ctx}/schedule/indexByMonth.do">日 程</a>
        </div>
        <div class="content">
		  <div>
            <s:iterator value="data.schedules" var="schedule">
            	<li>
                    <a href="${ctx}/schedule/view.do?model.id=${schedule.id}" title="${schedule.title}" target="_blank">
	            		<s:date name="beginTime" format="MM-dd"/>&nbsp;至&nbsp;<s:date name="endTime" format="MM-dd"/>
                      	&nbsp;&nbsp;${schedule.title}
                    </a>
            	</li>
            </s:iterator>
		  </div>
		</div>
      </div>
    </td>
    <td>
      <div id="link" class="deskpane">
        <div class="top">
        	<img src="${ctx}/images/icons/go.gif" >
        	常用网址
        </div>
        <div class="content">
        <marquee style="height: 180px;" direction="up" behavior="scroll" scrollamount="2" hspace="10" vspace="10" onMouseOver="this.stop()" onMouseOut="this.start()">
        	<ul style="line-height: 25px;">
        	</ul>
		</marquee>
        </div>
      </div>
    </td>
  </tr>
</table>
<script type="text/javascript"> 

function changeView(type, idSufffix, count){
	if (type != "news" && type != "diarys"){
		return;
	}
	
	for(var i=0; i <= count; i++){
		if(idSufffix == i){
			document.getElementById(type + i).style.display = '';	
		}else{
			document.getElementById(type + i).style.display = 'none';
		}
	}
}

function over(obj, type, idSufffix, count){
	obj.style.color = "#FF6600";
	obj.style.backgroundColor = "#DFE8F6";
	changeView(type, idSufffix, count);
}
function out(obj){
	obj.style.color = "#000";
	obj.style.backgroundColor = "#FFFFFF";
}

</script>
</body>
</html>